package cn.zju.ServiceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.zju.Service.ISearchEngineService;
import cn.zju.dao.PagesMapper;
import cn.zju.dao.RelateMapper;
import cn.zju.pojo.Pages;
import cn.zju.pojo.Relate;

@Service("searchEngineService")
public class SearchEngineServiceImpl implements ISearchEngineService {
	@Resource
	private PagesMapper pagesMapper;

	@Resource
	private RelateMapper relateMapper;

	public List<Pages> selectByKeyWordA(String keyWord) {
		return this.pagesMapper.selectByKeyWordA(keyWord);
	}

	public List<Pages> selectByKeyWordB(String keyWord1, String keyWord2) {
		return this.pagesMapper.selectByKeyWordB(keyWord1, keyWord2);
	}

	public List<Relate> selectRelateByKeyWordA(String keyWord) {
		return this.relateMapper.selectByKeyWordA(keyWord);
	}

	public List<Relate> selectRelateByKeyWordB(String keyWord1, String keyWord2) {
		return this.relateMapper.selectByKeyWordB(keyWord1, keyWord2);
	}
}
